package com.yangzc.lion.sys.security.model;

import java.util.List;

import org.springframework.security.core.GrantedAuthority;

import com.yangzc.lion.sys.organization.model.SysOrgPerson;
import com.yangzc.lion.sys.util.StringUtil;

/**
 * 验证机制用户信息
 * 
 */
public class SecurityUser extends
		org.springframework.security.core.userdetails.User {
	public SecurityUser(SysOrgPerson person, List<GrantedAuthority> authority) {
		super(person.getFdLoginName(), StringUtil
				.isNull(person.getFdPassword()) ? "0" : person.getFdPassword(),
				person.getFdIsAvailable(), true, true, true, authority);
		this.user = person;
	}

	private static final long serialVersionUID = 4408692144412758485L;

	private SysOrgPerson user;

	public SysOrgPerson getUser() {
		return user;
	}

	public void setUser(SysOrgPerson user) {
		this.user = user;
	}

}
